home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14563 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How can you make this work?
  5. Date: Mon, 15 Apr 96 18:28:23 GMT
  6. Organization: none
  7. Message-ID: <829592903snz@genesis.demon.co.uk>
  8. References: <4kr886$13t@hermes.oanet.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4kr886$13t@hermes.oanet.com> scorpion@portal.connect.ab.ca  writes:
  15.  
  16. >        I need to know why this gives an 'Illegal Pointer 
  17. >Arithmetic' error ; It's supposed to be a pixel write routine:
  18. >
  19. >void putpixel(short x,short y,unsigned char colour)
  20. >{       char far *Startofvidmem;
  21. >        char far *Location; /* Address of where to write the 
  22.  
  23. far isn't part of the C language but rather an extension provided by your
  24. particular compiler. Assuming you get the same error without it then...
  25.  
  26. >pixel*/
  27. >        Startofvidmem = 0xA000;
  28.  
  29. ...here you are trying to assign an integer to a pointer which is illegal.
  30. You could try casting to the appropriate type for assignment or maybe your
  31. implementation provides a macro in a header file that builds pointers to
  32. specific addresses for you (maybe something like MK_FP() ). However this is
  33. outside the realms of the C language - try comp.os.msdos.programmer for
  34. further discussion.
  35.  
  36. -- 
  37. -----------------------------------------
  38. Lawrence Kirby | fred@genesis.demon.co.uk
  39. Wilts, England | 70734.126@compuserve.com
  40. -----------------------------------------
  41.